using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Practices.EnterpriseLibrary.Common.Configuration;
using System.ComponentModel;
using System.Configuration;

namespace YB.EnterpriseLibrary.XSLTManager.Configuration
{
    public class XSLTManagerSettings : SerializableConfigurationSection
    {
        public const string SectionName = "XSLTManagerConfiguration";

        public XSLTManagerSettings()
            : this(String.Empty)
        { }

        public XSLTManagerSettings(string name)
        {
            this.Name = name;
        }

        private const string nameProperty = "name";
        [ConfigurationProperty(nameProperty)]
        [EditorBrowsable(EditorBrowsableState.Never)]
        public string Name
        {
            get
            {
                return (string)this[nameProperty];
            }
            set
            {
                this[nameProperty] = value;
            }
        }
        
        private const string defaultXSLTManagerNameProperty = "defaultXSLTManager";
        [ConfigurationProperty(defaultXSLTManagerNameProperty, IsRequired = true)]
        public string DefaultXSLTManager
        {
            get { return (string)this[defaultXSLTManagerNameProperty]; }
            set { this[defaultXSLTManagerNameProperty] = value; }
        }

        private const string xsltManagersProperty = "xsltManagers";
        [ConfigurationProperty(xsltManagersProperty, IsRequired = true)]
        public NamedElementCollection<XSLTManagerData> XSLTManagers
        {
            get { return (NamedElementCollection<XSLTManagerData>)base[xsltManagersProperty]; }
        }
    }
}
